package com.iot.redislock.core;
/**
 * 描述: DistributedLock.java 顶级接口
 * @author: myx
 * @date: 2018/5/22
 * Copyright © 2018-hotpot. All rights reserved.
 */
public interface DistributedLock {
    
    public static final long TIMEOUT_MILLIS = 30000;
    
    public static final int RETRY_TIMES = Integer.MAX_VALUE;
    
    public static final long SLEEP_MILLIS = 500;

    public boolean lock(String key);
    
    public boolean lock(String key, int retryTimes);
    
    public boolean lock(String key, int retryTimes, long sleepMillis);
    
    public boolean lock(String key, long expire);
    
    public boolean lock(String key, long expire, int retryTimes);
    
    public boolean lock(String key, long expire, int retryTimes, long sleepMillis);
    
    public boolean releaseLock(String key);
}